﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<Excell_On_Services.ViewModels.DepartmentsDisplayModel>" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <p class="mc_title">Managerment Department</p>
    <div class="content-box"><!-- Start Content Box -->
        <div class="content-box-header">
			<%--<form action="">
				Name department&nbsp;&nbsp;<input type="text" name="department"/>
				<input type="submit" value="Tìm kiếm" class="cbh_button" />
			</form>--%>
		</div>

        <div class="content-box-content">
			   
		    <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
			    <% if(ViewData["message"] !=null) {%>
			    <div class="notification attention png_bg">
				    <a href="#" class="close"><img src="../../Content/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
				    <div class="warning_text">
					    
                            <%=ViewData["message"] %>
                         
				    </div>
			    </div>
                <%} %>
                <table width="100%">
							
				    <thead style="color:#333333;">
					    <tr>
						    <th><input class="check-all" type="checkbox" /></th>
						    <th>Department Name</th>
						    <th>Description</th>
                            <th></th>
					    </tr>
								
				    </thead>

                    <tfoot>
					    <tr>
						    <td colspan="6">
							    <%--<div class="bulk-actions align-left">
								    <select name="dropdown">
									    <option value="option1">Choose an action...</option>
									    <option value="option2">Edit</option>
									    <option value="option3">Delete</option>
								    </select>
								    <a class="button" href="#">Apply to selected</a>
							    </div>--%>
										
							    <div class="pagination">
								    <% Html.RenderPartial("Pager", Model.PagerModel); %>
							    </div> <!-- End .pagination -->
							    <div class="clear"></div>
						    </td>
					    </tr>
				    </tfoot>

                    <tbody>
                        <% foreach (var item in Model.Departments) { %>
						<tr>
							<td><input type="checkbox" /></td>
							<td><%: item.DepartmentName%></td>
                            <td> 
                                    <% var des = Html.Encode(item.Description);
                                        des = des.Length > 100 ? (des.Substring(0, 100)) + "..." : des;
                                    %>
                                    <%= des %>
                            </td>

                            <td align="right" style="text-align: right; width: 100px;">
                                <a href="<%: Url.Action("Edit", new { id = item.DepartmentID}) %>" title="Edit" >
                                <img src="../../Content/images/icons/pencil.png" alt="Edit" />
                                </a>
                                <a href="<%: Url.Action("Delete", new { id = item.DepartmentID}) %>" title="Delete" >
                                   <img src="../../Content/images/icons/cross.png" alt="Delete" />
                                </a>	
							    <a href="<%: Url.Action("Details", new { id = item.DepartmentID}) %>" title="Details" >
                                   <img src="../../Content/images/icons/hammer_screwdriver.png" alt="Details" />
                                </a>
                            </td>
						</tr>
                        <% } %>
                    </tbody>

                </table>
            </div>
        </div>
    </div>

    <p>
        <a class="button" href="<%: Url.Action("Create") %>" title="Create new" >Create New </a>
    </p>

    
</asp:Content>
